import Types from '../actionTypes';

const initState = {
  historyList: [],
  current: 1,
  pageCount: 1,
};

export default (state = initState, action) => {
  const newState = JSON.parse(JSON.stringify(state));
  switch (action.type) {
    case Types.GET_HISTORY_INFO:
      newState.historyList = action.data.data;
      newState.current = action.data.page;
      newState.pageCount = action.data.pageCount;
      return newState;
    default:
      console.log('Types no match in historicalAlarm.js ....');
  }
  return state;
};
